package com.dubbo.consumer.controller.order;


import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.common.dtos.ResponseResult;
import com.dubbo.model.balance.dtos.PageRequestDto;
import com.dubbo.model.order.dtos.MountingsDTO;
import com.dubbo.model.order.dtos.MountingsOrderDTO;
import com.dubbo.model.order.pojos.MountingsOrder;
import com.dubbo.order.MountingsOrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/mountings")
public class MountingsOrderController {

    @Reference(check = false)
    private MountingsOrderService mountingsOrderService;

    /**
     * 页面展示
     * @return
     */
    @GetMapping("/paretsOrderList")
    public ResponseResult<List<MountingsOrder>> paretsOrderList(PageRequestDto dto){

        return mountingsOrderService.paretsOrderList(dto);
    }


    /**
     * 根据id查数据
     * @param id
     * @return
     */
    @GetMapping("/findById/{id}")
    public ResponseResult<MountingsDTO> findById(@PathVariable  Long id){
        return mountingsOrderService.findById(id);
    }

    /**
     * 分页条件查询
     * @param dto：
     * @return
     */
    @GetMapping("/selectByPage")
    public ResponseResult<List<MountingsOrder>> selectByPage(MountingsOrderDTO dto){
       return mountingsOrderService.selectByPage(dto);
    }


}
